I am a hobbyist and i enjoy playing and making games. I usually send these via SFSObjects, so really first time looking at serialization. I've triple and quadrouple checked the Documentation. http://docs2x.smartfoxserver.com/Advanc ... ialization
So to test and play around with class serialization i moved the RPG example extensions to MMORPG example. I rewritten the Action script Unity games files to C# and only created a set of the classes within Unity to get a base going before completely creating something new. All Server side scripts are standard from the RPG Example. (running locally).
So in the basics of trouble shooting. The client isn't 99% of the time receiving the data back from the server. I've done a server dump for what is sent and to who. So in order of server start>Connecting client>Exchanges.
Code: Select all
Connected
UnityEngine.Debug:Log(Object)
ConnectionUI:Start() (at Assets/Scripts/ConnectionUI.cs:76)
Login Request Sent
UnityEngine.Debug:Log(Object)
ConnectionUI:OnLoginButtonClick() (at Assets/Scripts/ConnectionUI.cs:90)
UnityEngine.EventSystems.EventSystem:Update()
Room Exisits Attempting to Join: testroom1
UnityEngine.Debug:Log(Object)
ConnectionUI:OnLogin(BaseEvent) (at Assets/Scripts/ConnectionUI.cs:151)
Sfs2X.Core.EventDispatcher:DispatchEvent(BaseEvent)
Sfs2X.SmartFox:ProcessEvents()
ConnectionUI:Update() (at Assets/Scripts/ConnectionUI.cs:81)
Spawned local player
UnityEngine.Debug:Log(Object)
GameManager:SpawnLocalPlayer(Int32, Int32) (at Assets/Scripts/GameManager.cs:288)
GameManager:Start() (at Assets/Scripts/GameManager.cs:123)
BuddyListInitCalled
UnityEngine.Debug:Log(Object)
GameManager:OnBuddyListInit(BaseEvent) (at Assets/Scripts/GameManager.cs:658)
Sfs2X.Core.EventDispatcher:DispatchEvent(BaseEvent)
Sfs2X.SmartFox:ProcessEvents()
GameManager:FixedUpdate() (at Assets/Scripts/GameManager.cs:150)
getModel - Request Sent.
UnityEngine.Debug:Log(Object)
GameManager:FixedUpdate() (at Assets/Scripts/GameManager.cs:171)
SERVER RESPONSE.
Code: Select all
9:01:22,222 INFO [SFSWorker:Ext:4] Extensions - {altExt}: getModel Sent back to: ( User Name: Unity, Id: 0, Priv: 0, Sess: 127.0.0.1:51368 )
09:01:22,222 INFO [SFSWorker:Ext:4] Extensions - {altExt}: Model: [SFSObject, size: 5]
09:01:22,224 INFO [SFSWorker:Ext:4] Extensions - {altExt}: Model:
(sfs_array) knights:
(class) altarianonline.model.RpgCharacter
(class) spell: altarianonline.model.DeathRaySpell
(class) knife: altarianonline.model.ShieldItem
(bool) isRpg: true
(int_array) randomValues: [100, 45, 62, 51, 7, 13, 161]
So in the c# Script i have this for extension response.
Code: Select all
void OnExtensionResponse(BaseEvent e)
{
Debug.Log("OnExtensionResponse called");
ISFSObject objIn = (SFSObject)e.Params["params"];
string cmd = (string)e.Params["cmd"];
Debug.Log(e.Params);
//Change to Switch statement for efficency
if (cmd == "setModel")
{
}
}
The Debug Log is never firing. So using a new MMORPG Example and dumping once the OnExtension response is called.
Code: Select all
getModel Sent.
UnityEngine.Debug:Log(Object)
GameManager:SpawnLocalPlayer(Int32, Int32) (at Assets/Scripts/GameManager.cs:240)
GameManager:Start() (at Assets/Scripts/GameManager.cs:57)
OnExtensionResponse called
UnityEngine.Debug:Log(Object)
GameManager:OnExtensionResponse(BaseEvent) (at Assets/Scripts/GameManager.cs:273)
Sfs2X.Core.EventDispatcher:DispatchEvent(BaseEvent)
Sfs2X.SmartFox:ProcessEvents()
GameManager:FixedUpdate() (at Assets/Scripts/GameManager.cs:67)
System.Collections.Hashtable
UnityEngine.Debug:Log(Object)
GameManager:OnExtensionResponse(BaseEvent) (at Assets/Scripts/GameManager.cs:276)
Sfs2X.Core.EventDispatcher:DispatchEvent(BaseEvent)
Sfs2X.SmartFox:ProcessEvents()
GameManager:FixedUpdate() (at Assets/Scripts/GameManager.cs:67)
Which i understand is fine? as I've not moved any classes into the new testing MMORPG Example.
That doesn't explain why the MMORPG example original doesn't have the extension firing.
So does anyone have an ideas on how i can debug these ?
Thanks!