Пример #1
0
        public AllTypeBean getAllTypeBean(bool aboolean, byte abyte,
                                          short ashort, char achar, int aint, long along, float afloat,
                                          double adouble, DateTime adate, String astring)
        {
            StandardTransferObject to = transferObjectFactory.createTransferObject();

            to.setCalleeClass("com.qileyuan.tatala.example.proxy.TestServerProxy");
            to.setCalleeMethod("getAllTypeBean");
            to.registerReturnType(TransferObject.DATATYPE_WRAPPER);

            to.putBoolean("aboolean", aboolean);
            to.putByte("abyte", abyte);
            to.putShort("ashort", ashort);
            to.putChar("achar", achar);
            to.putInt("aint", aint);
            to.putLong("along", along);
            to.putFloat("afloat", afloat);
            to.putDouble("adouble", adouble);
            to.putDate("adate", adate);
            to.putString("astring", astring);

            AllTypeBeanWrapper allTypeBeanWrapper = (AllTypeBeanWrapper)ServerExecutor.execute(to);

            if (allTypeBeanWrapper != null)
            {
                return(allTypeBeanWrapper.getAllTypeBean());
            }
            else
            {
                return(null);
            }
        }
Пример #2
0
        public TestAccount getAccountCompress(TestAccount account)
        {
            StandardTransferObject to = transferObjectFactory.createTransferObject();

            to.setCalleeClass("com.qileyuan.tatala.example.proxy.TestServerProxy");
            to.setCalleeMethod("getAccount");
            to.registerReturnType(TransferObject.DATATYPE_WRAPPER);

            TestAccountWrapper accountWrapper = new TestAccountWrapper(account);

            to.putWrapper("account", accountWrapper);
            to.setCompress(true);

            accountWrapper = (TestAccountWrapper)ServerExecutor.execute(to);

            if (accountWrapper != null)
            {
                TestAccount returnAccount = accountWrapper.getAccount();
                return(returnAccount);
            }
            else
            {
                return(null);
            }
        }
Пример #3
0
        public void Logout()
        {
            NewTransferObject to = transferObjectFactory.createNewTransferObject();

            to.setCalleeMethod(LongClientSession.METHOD_CLOSE);
            to.registerReturnType(TransferObject.DATATYPE_VOID);
            ServerExecutor.execute(to);
        }
Пример #4
0
        public void doSomething()
        {
            NewTransferObject to = transferObjectFactory.createNewTransferObject();

            to.setCalleeClass("com.qileyuan.tatala.example.proxy.NewToServerProxy");
            to.setCalleeMethod("doSomething");
            to.registerReturnType(TransferObject.DATATYPE_VOID);
            ServerExecutor.execute(to);
        }
Пример #5
0
        public void ExitLobby(int userID)
        {
            NewTransferObject to = transferObjectFactory.createNewTransferObject();

            to.setCalleeMethod(ExecuteClientCallMethodName);
            to.putString("exitLobby"); //callee method
            to.putInt(userID);
            to.registerReturnType(TransferObject.DATATYPE_VOID);
            ServerExecutor.execute(to);
        }
Пример #6
0
        public void sendMessage(String message)
        {
            StandardTransferObject to = transferObjectFactory.createTransferObject();

            to.setCalleeClass("com.qileyuan.tatala.example.proxy.ChatRoomServerProxy");
            to.setCalleeMethod("receiveMessage");
            to.putString("message", message);
            to.registerReturnType(TransferObject.DATATYPE_VOID);
            ServerExecutor.execute(to);
        }
Пример #7
0
        public void login(String username)
        {
            StandardTransferObject to = transferObjectFactory.createTransferObject();

            to.setCalleeClass("com.qileyuan.tatala.example.proxy.ChatRoomServerProxy");
            to.setCalleeMethod("login");
            to.putString("username", username);
            to.registerReturnType(TransferObject.DATATYPE_VOID);
            ServerExecutor.execute(to);
        }
Пример #8
0
        public void SendMovement(int userID, float[] target)
        {
            NewTransferObject to = transferObjectFactory.createNewTransferObject();

            to.setCalleeMethod(ExecuteClientCallMethodName);
            to.putString("receiveMovement"); //callee method
            to.putInt(userID);
            to.putFloatArray(target);
            to.registerReturnType(TransferObject.DATATYPE_VOID);
            ServerExecutor.execute(to);
        }
Пример #9
0
        public void SendMessage(int userID, string message)
        {
            NewTransferObject to = transferObjectFactory.createNewTransferObject();

            to.setCalleeMethod(ExecuteClientCallMethodName);
            to.putString("receiveMessage"); //callee method
            to.putInt(userID);
            to.putString(message);
            to.registerReturnType(TransferObject.DATATYPE_VOID);
            ServerExecutor.execute(to);
        }
Пример #10
0
        public void EnterLobby(int userID, string userName, int userLevel, int equipedWeaponTypeId, float[] position)
        {
            NewTransferObject to = transferObjectFactory.createNewTransferObject();

            to.setCalleeMethod(ExecuteClientCallMethodName);
            to.putString("enterLobby"); //callee method
            to.putInt(userID);
            to.putString(userName);
            to.putInt(userLevel);
            to.putInt(equipedWeaponTypeId);
            to.putFloatArray(position);
            to.registerReturnType(TransferObject.DATATYPE_VOID);
            ServerExecutor.execute(to);
        }
Пример #11
0
        public String sayHello(int Id, String name)
        {
            NewTransferObject to = transferObjectFactory.createNewTransferObject();

            to.setCalleeClass("com.qileyuan.tatala.example.proxy.NewToServerProxy");
            to.setCalleeMethod("sayHello");
            to.registerReturnType(TransferObject.DATATYPE_STRING);

            to.putInt(Id);
            to.putString(name);

            Object resultObj = ServerExecutor.execute(to);
            String result    = (String)resultObj;

            return(result);
        }
Пример #12
0
        public String[] getArray(int[] intarr, String[] strarr)
        {
            NewTransferObject to = transferObjectFactory.createNewTransferObject();

            to.setCalleeClass("com.qileyuan.tatala.example.proxy.NewToServerProxy");
            to.setCalleeMethod("getArray");
            to.registerReturnType(TransferObject.DATATYPE_STRINGARRAY);

            to.putIntArray(intarr);
            to.putStringArray(strarr);

            Object resultObj = ServerExecutor.execute(to);

            String[] result = (String[])resultObj;

            return(result);
        }
Пример #13
0
        public TestAccount getAccountAsynchronous(TestAccount account)
        {
            StandardTransferObject to = transferObjectFactory.createTransferObject();

            to.setCalleeClass("com.qileyuan.tatala.example.proxy.TestServerProxy");
            to.setCalleeMethod("getAccount");
            to.registerReturnType(TransferObject.DATATYPE_WRAPPER);

            TestAccountWrapper accountWrapper = new TestAccountWrapper(account);

            to.putWrapper("account", accountWrapper);
            to.setAsynchronous(true);

            Future future = (Future)ServerExecutor.execute(to);

            accountWrapper = (TestAccountWrapper)future.Get();
            TestAccount returnAccount = accountWrapper.getAccount();

            return(returnAccount);
        }