Sha256: 9f730f51e4c3c13627937300e3bef8420a0d3aa43e0b988bb527ee4dc4a88d21

Contents?: true

Size: 1.17 KB

Versions: 4

Compression:

Stored size: 1.17 KB

Contents

from com.smartfoxserver.v2.core import *
from com.smartfoxserver.v2.exceptions import *
from com.smartfoxserver.v2.entities import *
from com.smartfoxserver.v2.entities.data import *
from com.smartfoxserver.bitswarm.sessions import *
from com.smartfoxserver.v2.api import *
from com.smartfoxserver.v2.util import *

from java.lang import Thread

class ServerEventListener(ISFSEventListener):
	def handleServerEvent(self, event):
		trace("Event: " + event.toString())

sfsEventListener = None
VERSION = "1.0.1"

def init():
	global sfsEventListener
	from java.io import *

	sfsEventListener = ServerEventListener()
	_base.addEventListener(SFSEventType.SERVER_READY, sfsEventListener)
	
	trace("Python extension started: ", _base, _sfsApi)
	trace("Version: ", VERSION)
	trace("Folder: ", _base.getCurrentFolder())

def destroy():
	_base.removeEventListener(SFSEventType.SERVER_READY, sfsEventListener)
	trace("Python extension destroyed: ", _base)
	
def handleClientRequest(cmd, sender, params):
	trace("Request: ", cmd, sender, params)
	
	if cmd == "hello":
		response = SFSObject()
		response.putUtfString("res", "Hello to you, " + sender.getName())	
		_base.send("hello", response, sender)
	
	
	

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
rubyfox-server-2.12.5.1 lib/rubyfox/server/data/extensions/pyTest/Simple.py
rubyfox-server-2.12.5.0 lib/rubyfox/server/data/extensions/pyTest/Simple.py
rubyfox-server-2.12.4.0 lib/rubyfox/server/data/extensions/pyTest/Simple.py
rubyfox-server-2.12.1.0 lib/rubyfox/server/data/extensions/pyTest/Simple.py