Esempio n. 1
0
        public NWEvent(NWServerAction serverAction)
        {
            if (serverAction.ActionsParams.ContainsKey((int)eEventKeys.Type))
            {
                Type = (NWEventType)serverAction.ActionsParams[(int)eEventKeys.Type];
            }

            if (serverAction.ActionsParams.ContainsKey((int)eEventKeys.Data))
            {
                Data = (Hashtable)serverAction.ActionsParams[(int)eEventKeys.Data];
            }
        }
Esempio n. 2
0
 void INWNetworking.SendAction(NWServerAction serverAction)
 {
     _queuedActions.Add(serverAction);
 }
Esempio n. 3
0
    void OnEventHandler(byte eventCode, object content, int senderId)
    {
        Debug.Log("got event: " + eventCode + " content: " + content + " senderId: " + senderId);

        if (OnReciveAction != null)
        {
            Hashtable[] actionsList = (Hashtable[])content;

            for (int i=0; i < actionsList.Length; i++)
            {
                Hashtable actionHash = (Hashtable)actionsList[i];
                NWServerAction serverAction = new NWServerAction(actionHash);
                OnReciveAction(serverAction);
            }
        }
    }
Esempio n. 4
0
 public NWServerAction ToServerAction()
 {
     Hashtable hash = new Hashtable();
     hash.Add((int)eEventKeys.Type, Type);
     if (Data != null)
     {
         hash.Add((int)eEventKeys.Data, Data);
     }
     NWServerAction serverAction = new NWServerAction(ServerActionType.GameplayEvent, hash);
     return serverAction;
 }