Example #1
0
 public override bool AddPipe(Pipe ppe, io IO)
 {
     if (IO == io.output && this.outputPipe == null)
     {
         this.outputPipe = ppe;
         UpdateOutput();
         return(true);
     }
     else if (IO == io.input)
     {
         if (inputPipe1 == null)
         {
             this.inputPipe1 = ppe;
             UpdateOutput();
             return(true);
         }
         else if (inputPipe2 == null)
         {
             this.inputPipe2 = ppe;
             UpdateOutput();
             return(true);
         }
     }
     return(false);
 }
Example #2
0
    protected override void OnInit(EventArgs e)
    {
        base.OnInit(e);

        // inizializzazione
        _cmd = master.check_cmd(qry_val("cmd"));

        // elab requests & cmds
        if (this.IsPostBack)
        {
            return;
        }

        try {
            io ob = new io();

            // js request
            if (json_request.there_request(this))
            {
                json_result res = new json_result(json_result.type_result.ok);

                try {
                    json_request jr = new json_request(this);

                    // save_file
                    if (jr.action == "save_file")
                    {
                        synch    s     = ob.get_synch(jr.val_int("user_id"), jr.val_str("user_name"));
                        Encoding enc   = System.Text.Encoding.GetEncoding(jr.val_str("enc"));
                        byte[]   bytes = jr.val_bytes("bin_data", enc);
                        string   path  = ob.file_path(jr.val_int("id"));
                        File.WriteAllBytes(path, bytes);
                        s.set_file_content_db(jr.val_int("id"), Path.GetExtension(path).ToLower(), enc.GetString(bytes), DateTime.Now, DateTime.Now);
                    } // synch folders
                    else if (jr.action == "synch_folders")
                    {
                        synch s = ob.get_synch(jr.val_int("user_id"), jr.val_str("user_name"));
                        s.synch_event += s_synch_event;
                        synch_results rf = s.reload_folders();
                        res.data     = rf;
                        res.contents = _synch_events;
                    }
                } catch (Exception ex) { log.log_err(ex); res = new json_result(json_result.type_result.error, ex.Message); }

                write_response(res);

                return;
            }

            // tasks
            //if(_cmd != null && _cmd.action == "view" && _cmd.obj == "tasks") {
            //  int? fi = qry_val("idt") != "" ? qry_int("idt") : (qry_val("id") != "" ? qry_int("id") : (int?)null)
            //    , sfi = qry_val("sft") != "" ? qry_int("sft") : (qry_val("sf") != "" ? qry_int("sf") : (int?)null);
            //} else throw new Exception("COMANDO NON RICONOSCIUTO!");
        } catch (Exception ex) { log.log_err(ex); if (!json_request.there_request(this))
                                 {
                                     master.err_txt(ex.Message);
                                 }
        }
    }
 public void OnCharacterGet(string playerId, io.gamemachine.messages.Character character)
 {
     Messenger messenger = ActorSystem.instance.Find("Messenger") as Messenger;
     string myPlayerId = GameEntityManager.GetPlayerEntity().GetEntityId();
     messenger.InviteToChannel(myPlayerId, character.playerId, requestedGroup);
     Debug.Log("invite sent to " + character.playerId + " for channel " + requestedGroup);
 }
Example #4
0
 public override bool AddPipe(Pipe ppe, io IO)
 {
     if (outputPipe == null && IO == io.output)
     {
         base.AddPipe(ppe, IO);
         this.outputPipe      = ppe;
         this.outputPipe.Flow = this.currentFlow;
         return(true);
     }
     return(false);
 }
Example #5
0
    public static void Main(string[] argv)
    {
        io myio = new io();

        try
        {
            while (myio.allowedValue())
            {
                myio.test();
            }
        }
        catch (Exception myexp)
        {
            Console.WriteLine(myexp.ToString());
        }
    }
Example #6
0
 public override bool AddPipe(Pipe ppe, io IO)
 {
     if (IO == io.input && inputPipe == null)
     {
         inputPipe = ppe;
         if (outputPipe1 != null)
         {
             outputPipe1.Flow = inputPipe.Flow * this.percentOut1;
         }
         if (outputPipe2 != null)
         {
             outputPipe2.Flow = inputPipe.Flow * (1 - this.percentOut1);
         }
         return(true);
     }
     else if (IO == io.output)
     {
         if (outputPipe1 == null)
         {
             outputPipe1 = ppe;
             if (inputPipe != null)
             {
                 outputPipe1.Flow = inputPipe.Flow * PercentOut1;
             }
             outputPipe1.Label = 'A';
             return(true);
         }
         else if (outputPipe2 == null)
         {
             outputPipe2 = ppe;
             if (inputPipe != null)
             {
                 outputPipe2.Flow = inputPipe.Flow * (1 - PercentOut1);
             }
             outputPipe2.Label = 'B';
             return(true);
         }
     }
     return(false);
 }
Example #7
0
 public CastHandler(io.IOClient client, PlayerHandler handler)
 {
     this.client = client;
     this.handler = handler;
 }
Example #8
0
 public Query(string viewName, int connectionIndex, io.AppDomain.App app)
 {
     _viewName = viewName;
     _connectionString = app.Connections[connectionIndex];
     _app = app;
 }
Example #9
0
 void IPlayerApi.OnPlayerCharacters(io.gamemachine.messages.Characters characters)
 {
     throw new System.NotImplementedException();
 }
Example #10
0
 void IAdminApi.OnPlayerSearch(io.gamemachine.messages.Players players)
 {
     throw new System.NotImplementedException();
 }
Example #11
0
 public CombatHandler2(io.IOClient client, PlayerHandler handler)
 {
     this.client = client;
     this.handler = handler;
 }
Example #12
0
        public static LKCamelot.model.Player LoadPlayer(io.IOClient client, string name)
        {
            lock (readPlayerlock)
            {
                LKCamelot.model.Player ret = null;
                using (StreamReader sr = new StreamReader("worldsavePl.txt"))
                {
                    while (!sr.EndOfStream)
                    {
                        string[] line = sr.ReadLine().Split(',');
                        if (line[1] != name)
                            continue;

                        ret = new LKCamelot.model.Player(client);

                        ret.Serial = Convert.ToInt32(line[0]);
                        ret.Name = line[1];
                        ret.Pass = line[2];
                        ret.Class = (LKCamelot.library.Class)Convert.ToInt32(line[3]);
                        ret.Stage = (byte)Convert.ToInt32(line[4]);
                        ret.LightRad = (byte)Convert.ToInt32(line[5]);
                        ret.Transparancy = (byte)Convert.ToInt32(line[6]);
                        ret.Map = line[7];
                        ret.Loc = new model.Point2D(Convert.ToInt32(line[8]), Convert.ToInt32(line[9]));
                        ret.Face = (byte)Convert.ToInt32(line[10]);
                        ret.apStr = (ushort)Convert.ToInt32(line[11]);
                        ret.apMen = (ushort)Convert.ToInt32(line[12]);
                        ret.apDex = (ushort)Convert.ToInt32(line[13]);
                        ret.apVit = (ushort)Convert.ToInt32(line[14]);
                        ret.m_Extra = (ushort)Convert.ToInt32(line[15]);
                        ret.m_HP = (ushort)Convert.ToInt32(line[16]);
                        ret.m_HPCur = (ushort)Convert.ToInt32(line[17]);
                        ret.m_MP = (ushort)Convert.ToInt32(line[18]);
                        ret.m_MPCur = Convert.ToInt32(line[19]);
                        ret.m_Level = (short)Convert.ToInt32(line[20]);
                        ret.m_XP = Convert.ToInt32(line[21]);
                        ret.m_Gold = Convert.ToUInt64(line[22]);
                        ret.LoadMagic(line[23]);
                    }
                }
                return ret;
            }
        }
Example #13
0
 public void OnPlayerCreated(io.gamemachine.messages.Player player)
 {
     throw new System.NotImplementedException();
 }
Example #14
0
 public void OnPlayer(io.gamemachine.messages.Player player)
 {
     AddGroupMember(player.id, player.characterId);
 }
 public void OnCharacterCreated(io.gamemachine.messages.Character character)
 {
     throw new NotImplementedException();
 }
Example #16
0
 public Query(int connectionIndex, io.AppDomain.App app)
 {
     _connectionString = app.Connections[connectionIndex];
     _app = app;
 }
Example #17
0
 public virtual bool AddPipe(Pipe ppe, io IO)
 {
     return(false);
 }