Exemplo n.º 1
0
 public void Init(NetworkCommandInfo cmd, NetworkArgument arg, Action <NetBaseMsg> successCallback, Action <NetMsg <string> > failCallback, Func <NetMsg <string>, bool> exceptionCallback)
 {
     arg = arg ?? new NetworkArgument();
     this.commandInfo       = cmd;
     this.net_id            = sq++;
     this.arg               = arg;
     this.successCallback   = successCallback;
     this.failCallback      = failCallback;
     this.exceptionCallback = exceptionCallback;
 }
Exemplo n.º 2
0
    // clone current object
    public NetworkArgument clone()
    {
        NetworkArgument arg = new NetworkArgument();

        foreach (KeyValuePair <string, string> keyVal in mParams)
        {
            arg.mParams[keyVal.Key] = keyVal.Value;
        }
        return(arg);
    }
Exemplo n.º 3
0
 public static void Request(uint id, NetworkArgument arg, Action <NetBaseMsg> successCallback, Action <NetMsg <string> > faillCallback, Func <NetMsg <string>, bool> exceptionCallback)
 {
     if (commandInfoTable.ContainsKey(id))
     {
         NetworkCommandInfo cmd     = commandInfoTable[id];
         NetworkRoutine     routine = FetchIdleRoutine();
         routine.Init(cmd, arg, successCallback, faillCallback, exceptionCallback);
         willPostQueue.Enqueue(routine);
         if (routine.commandInfo.isBlock)
         {
             if (blockInputHandler != null)
             {
                 blockInputHandler.Invoke(true);
             }
         }
         UpdateManager.Add(updateObj);
     }
 }
Exemplo n.º 4
0
 public static void Request(uint id, NetworkArgument arg, Action <NetBaseMsg> successCallback, Action <NetMsg <string> > failCallback)
 {
     Request(id, arg, successCallback, failCallback, defaultExcetionCallback);
 }
Exemplo n.º 5
0
 public static void Request(uint id, NetworkArgument arg, Action <NetBaseMsg> successCallback = null)
 {
     Request(id, arg, successCallback, defaultFailCallback, defaultExcetionCallback);
 }