Hello devs,
I have discovered a thing that is a bit confusing for me. I don't have enough experience in client section, however I would like somebody to explain me how this things works.
I'm talking here about connection between files in Root package and client binary. Let's move on to my question.
Okay, let's take a function form IntroLogin.py:
net.SetPhaseWindow(net.PHASE_WINDOW_LOGIN, self)
I though that this function has it's definition in NetworkModule.py:
def SetPhaseWindow(self, newPhaseWindow):
if self.newPhaseWindow:
print "Already changed to a new window, ", newPhaseWindow
self.__ChangePhaseWindow()
self.newPhaseWindow = newPhaseWindow
if self.curPhaseWindow:
print "Change when fade out."
self.curtain.FadeOut(self.__ChangePhaseWindow)
else:
print "Current window does not exist."
self.__ChangePhaseWindow()
But here is a problem with arguments. Function in NetworkModule.py has two parameters, self and newPhaseWindow. So if this definition is from function in IntroLogin.py it would looks like: net.PHASE_WINDOW_LOGIN is a self argument and self (of SetPhaseWindow() function) is newPhaseWindow. I think there is not problem with second argument, but first could not be correct.
So I've been looking for definition in client binary...
Here we go, PythonNetworkStream.cpp:
void CPythonNetworkStream::SetPhaseWindow(UINT ePhaseWnd, PyObject* poPhaseWnd)
{
if (ePhaseWnd >= PHASE_WINDOW_NUM)
{
return;
}
m_apoPhaseWnd[ePhaseWnd] = poPhaseWnd;
}
Yes, this probably could be that we are searching for, BUT! We have a bit similar function (by name) in PythonNetworkStreamModule.cpp:
And we know that our function is called with net module. So could this be a definition?
PyObject* netSetPhaseWindow(PyObject* poSelf, PyObject* poArgs)
{
int ePhaseWnd;
if (!PyTuple_GetInteger(poArgs, 0, &ePhaseWnd))
return Py_BuildException();
PyObject* poPhaseWnd;
if (!PyTuple_GetObject(poArgs, 1, &poPhaseWnd))
return Py_BuildException();
CPythonNetworkStream& rkNetStream=CPythonNetworkStream::Instance();
rkNetStream.SetPhaseWindow(ePhaseWnd, poPhaseWnd);
return Py_BuildNone();
}
List of questions:
What does net module do? Where can I find it? Can I compile it by myself?
What definition is from function in IntroLogin.py?
Why there are those two functions in binary? What does each of them do?
Thanks for all replies, regards Chyu ^^.