Exemplo n.º 1
0
    private static NetworkRoutine FetchIdleRoutine()
    {
        NetworkRoutine routine = null;

        if (bank.Count > 0)
        {
            routine = bank.Dequeue();
        }
        else
        {
            routine = new NetworkRoutine();
        }
        return(routine);
    }
Exemplo n.º 2
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);
     }
 }