Reputation: 111
This is my server code:
from Mastermind import *
from time import gmtime, strftime
import globalv as g
from db import *
class Server(MastermindServerTCP):
def __init__(self):
MastermindServerTCP.__init__(self, 0.5,0.5,10.0)
def serverAlert(self, msg="Test"):
print(msg)
def connectAlert(self, username):
timestamp = strftime("%H:%M:%S", gmtime())
print(username + " connected to the server at: '%s'" % timestamp)
if __name__ == '__main__':
....(Start server etc.)
What I want to do, that I don't really know how, is I want to be able to call the connectAlert() function from my client, which would be placed on a different computer. If it's not possible, what's the best way to achieve the same result?
Upvotes: 0
Views: 388
Reputation: 143097
You can't call this function directly.
It works this way (pseudocode):
"call connectAlert for me"
, if data == "call connectAlert for me": connectAlert(..)
EDIT:
Looking for information about Mastermind
library I found this code:
https://github.com/propra13-orga/gruppe75/tree/master/Dungeoncrawler
See chat_client.py
(MastermindClientTCP
) and chat_server.py
(MastermindServerTCP
)
Upvotes: 1