public Server(Ice.Communicator iceCommunicator, string clientEndpoint, Murmur.ServerPrx proxy, string name) { Users.CollectionChanged += OnUsersCollectionChanged; ServerProxy = proxy; Name = name; try { var servant = new ServerCallback(this); var adapter = iceCommunicator.createObjectAdapterWithEndpoints("", clientEndpoint); var servantProxy = adapter.addWithUUID(servant); ServerCallbackProxy = Murmur.ServerCallbackPrxHelper.checkedCast(servantProxy); adapter.activate(); // TODO: Allow user to provide Ice secret var context = new Dictionary<string, string>(); context["secret"] = ""; ServerProxy.ice_getConnection().setAdapter(adapter); ServerProxy.addCallback(ServerCallbackProxy, context); ServerProxy.begin_getUsers().whenCompleted( users => { CompleteGetUsers(users); }, e => { System.Diagnostics.Debug.WriteLine("Could not get user dictionary for {0}: {1}", Name, e.ToString()); } ); } catch (Ice.Exception e) { System.Diagnostics.Debug.WriteLine("Error talking to {0}: {1}", Name, e.ToString()); } }
public void contextAction(string action, Murmur.User usr, int session, int channelid, _System.Collections.Generic.Dictionary<string, string> context__) { IceInternal.Outgoing og__ = handler__.getOutgoing("contextAction", Ice.OperationMode.Idempotent, context__); try { try { IceInternal.BasicStream os__ = og__.ostr(); os__.writeString(action); if(usr == null) { Murmur.User tmp__ = new Murmur.User(); tmp__.write__(os__); } else { usr.write__(os__); } os__.writeInt(session); os__.writeInt(channelid); } catch(Ice.LocalException ex__) { og__.abort(ex__); } bool ok__ = og__.invoke(); if(!og__.istr().isEmpty()) { try { if(!ok__) { try { og__.throwUserException(); } catch(Ice.UserException ex__) { throw new Ice.UnknownUserException(ex__.ice_name(), ex__); } } og__.istr().skipEmptyEncaps(); } catch(Ice.LocalException ex__) { throw new IceInternal.LocalExceptionWrapper(ex__, false); } } } finally { handler__.reclaimOutgoing(og__); } }
public void stopped(Murmur.ServerPrx srv, _System.Collections.Generic.Dictionary<string, string> context__) { IceInternal.Outgoing og__ = handler__.getOutgoing("stopped", Ice.OperationMode.Normal, context__); try { try { IceInternal.BasicStream os__ = og__.ostr(); Murmur.ServerPrxHelper.write__(os__, srv); } catch(Ice.LocalException ex__) { og__.abort(ex__); } bool ok__ = og__.invoke(); if(!og__.istr().isEmpty()) { try { if(!ok__) { try { og__.throwUserException(); } catch(Ice.UserException ex__) { throw new Ice.UnknownUserException(ex__.ice_name(), ex__); } } og__.istr().skipEmptyEncaps(); } catch(Ice.LocalException ex__) { throw new IceInternal.LocalExceptionWrapper(ex__, false); } } } finally { handler__.reclaimOutgoing(og__); } }
public static void write(IceInternal.BasicStream os__, Murmur.Tree[] v__) { if(v__ == null) { os__.writeSize(0); } else { os__.writeSize(v__.Length); for(int ix__ = 0; ix__ < v__.Length; ++ix__) { os__.writeObject(v__[ix__]); } } }
private void removeContextCallback(Murmur.ServerContextCallbackPrx cb, _System.Collections.Generic.Dictionary<string, string> context__, bool explicitContext__) { if(explicitContext__ && context__ == null) { context__ = emptyContext_; } int cnt__ = 0; while(true) { Ice.ObjectDel_ delBase__ = null; try { checkTwowayOnly__("removeContextCallback"); delBase__ = getDelegate__(false); ServerDel_ del__ = (ServerDel_)delBase__; del__.removeContextCallback(cb, context__); return; } catch(IceInternal.LocalExceptionWrapper ex__) { handleExceptionWrapper__(delBase__, ex__, null); } catch(Ice.LocalException ex__) { handleException__(delBase__, ex__, null, ref cnt__); } } }
public void setState(Murmur.User state, _System.Collections.Generic.Dictionary<string, string> context__) { setState(state, context__, true); }
public void setChannelState(Murmur.Channel state) { setChannelState(state, null, false); }
public void setBans(Murmur.Ban[] bans) { setBans(bans, null, false); }
public void addContextCallback(int session, string action, string text, Murmur.ServerContextCallbackPrx cb, int ctx) { addContextCallback(session, action, text, cb, ctx, null, false); }
public void addCallback(Murmur.ServerCallbackPrx cb) { addCallback(cb, null, false); }
public static void write(IceInternal.BasicStream os__, Murmur.ServerPrx[] v__) { if(v__ == null) { os__.writeSize(0); } else { os__.writeSize(v__.Length); for(int ix__ = 0; ix__ < v__.Length; ++ix__) { Murmur.ServerPrxHelper.write__(os__, v__[ix__]); } } }
private void contextAction(string action, Murmur.User usr, int session, int channelid, _System.Collections.Generic.Dictionary<string, string> context__, bool explicitContext__) { if(explicitContext__ && context__ == null) { context__ = emptyContext_; } int cnt__ = 0; while(true) { Ice.ObjectDel_ delBase__ = null; try { delBase__ = getDelegate__(false); ServerContextCallbackDel_ del__ = (ServerContextCallbackDel_)delBase__; del__.contextAction(action, usr, session, channelid, context__); return; } catch(IceInternal.LocalExceptionWrapper ex__) { handleExceptionWrapperRelaxed__(delBase__, ex__, null, ref cnt__); } catch(Ice.LocalException ex__) { handleException__(delBase__, ex__, null, ref cnt__); } } }
public void contextAction(string action, Murmur.User usr, int session, int channelid, _System.Collections.Generic.Dictionary<string, string> context__) { contextAction(action, usr, session, channelid, context__, true); }
public void getACL(int channelid, out Murmur.ACL[] acls, out Murmur.Group[] groups, out bool inherit, _System.Collections.Generic.Dictionary<string, string> context__) { IceInternal.Outgoing og__ = handler__.getOutgoing("getACL", Ice.OperationMode.Idempotent, context__); try { try { IceInternal.BasicStream os__ = og__.ostr(); os__.writeInt(channelid); } catch(Ice.LocalException ex__) { og__.abort(ex__); } bool ok__ = og__.invoke(); try { if(!ok__) { try { og__.throwUserException(); } catch(Murmur.InvalidChannelException) { throw; } catch(Murmur.ServerBootedException) { throw; } catch(Ice.UserException ex__) { throw new Ice.UnknownUserException(ex__.ice_name(), ex__); } } IceInternal.BasicStream is__ = og__.istr(); is__.startReadEncaps(); { int szx__ = is__.readSize(); is__.startSeq(szx__, 16); acls = new Murmur.ACL[szx__]; for(int ix__ = 0; ix__ < szx__; ++ix__) { acls[ix__] = new Murmur.ACL(); acls[ix__].read__(is__); is__.checkSeq(); is__.endElement(); } is__.endSeq(szx__); } { int szx__ = is__.readSize(); is__.startSeq(szx__, 7); groups = new Murmur.Group[szx__]; for(int ix__ = 0; ix__ < szx__; ++ix__) { groups[ix__] = new Murmur.Group(); groups[ix__].read__(is__); is__.checkSeq(); is__.endElement(); } is__.endSeq(szx__); } inherit = is__.readBool(); is__.endReadEncaps(); } catch(Ice.LocalException ex__) { throw new IceInternal.LocalExceptionWrapper(ex__, false); } } finally { handler__.reclaimOutgoing(og__); } }
public void addContextCallback(int session, string action, string text, Murmur.ServerContextCallbackPrx cb, int ctx, _System.Collections.Generic.Dictionary<string, string> context__) { addContextCallback(session, action, text, cb, ctx, context__, true); }
public int Murmur_binary_hash() => Murmur.Hash(testBinary);
public void getACL(int channelid, out Murmur.ACL[] acls, out Murmur.Group[] groups, out bool inherit) { getACL(channelid, out acls, out groups, out inherit, null, false); }
public void setBans(Murmur.Ban[] bans, _System.Collections.Generic.Dictionary<string, string> context__) { setBans(bans, context__, true); }
public void getACL(int channelid, out Murmur.ACL[] acls, out Murmur.Group[] groups, out bool inherit, _System.Collections.Generic.Dictionary<string, string> context__) { getACL(channelid, out acls, out groups, out inherit, context__, true); }
public void setState(Murmur.User state) { setState(state, null, false); }
public void removeContextCallback(Murmur.ServerContextCallbackPrx cb) { removeContextCallback(cb, null, false); }
private void getACL(int channelid, out Murmur.ACL[] acls, out Murmur.Group[] groups, out bool inherit, _System.Collections.Generic.Dictionary<string, string> context__, bool explicitContext__) { if(explicitContext__ && context__ == null) { context__ = emptyContext_; } int cnt__ = 0; while(true) { Ice.ObjectDel_ delBase__ = null; try { checkTwowayOnly__("getACL"); delBase__ = getDelegate__(false); ServerDel_ del__ = (ServerDel_)delBase__; del__.getACL(channelid, out acls, out groups, out inherit, context__); return; } catch(IceInternal.LocalExceptionWrapper ex__) { handleExceptionWrapperRelaxed__(delBase__, ex__, null, ref cnt__); } catch(Ice.LocalException ex__) { handleException__(delBase__, ex__, null, ref cnt__); } } }
public void removeContextCallback(Murmur.ServerContextCallbackPrx cb, _System.Collections.Generic.Dictionary<string, string> context__) { removeContextCallback(cb, context__, true); }
private void setState(Murmur.User state, _System.Collections.Generic.Dictionary<string, string> context__, bool explicitContext__) { if(explicitContext__ && context__ == null) { context__ = emptyContext_; } int cnt__ = 0; while(true) { Ice.ObjectDel_ delBase__ = null; try { checkTwowayOnly__("setState"); delBase__ = getDelegate__(false); ServerDel_ del__ = (ServerDel_)delBase__; del__.setState(state, context__); return; } catch(IceInternal.LocalExceptionWrapper ex__) { handleExceptionWrapperRelaxed__(delBase__, ex__, null, ref cnt__); } catch(Ice.LocalException ex__) { handleException__(delBase__, ex__, null, ref cnt__); } } }
public void setACL(int channelid, Murmur.ACL[] acls, Murmur.Group[] groups, bool inherit) { setACL(channelid, acls, groups, inherit, null, false); }
public static void write(IceInternal.BasicStream os__, Murmur.User[] v__) { if(v__ == null) { os__.writeSize(0); } else { os__.writeSize(v__.Length); for(int ix__ = 0; ix__ < v__.Length; ++ix__) { (v__[ix__] == null ? new Murmur.User() : v__[ix__]).write__(os__); } } }
public void setACL(int channelid, Murmur.ACL[] acls, Murmur.Group[] groups, bool inherit, _System.Collections.Generic.Dictionary<string, string> context__) { setACL(channelid, acls, groups, inherit, context__, true); }
public void userStateChanged(Murmur.User state, _System.Collections.Generic.Dictionary<string, string> context__) { IceInternal.Outgoing og__ = handler__.getOutgoing("userStateChanged", Ice.OperationMode.Idempotent, context__); try { try { IceInternal.BasicStream os__ = og__.ostr(); if(state == null) { Murmur.User tmp__ = new Murmur.User(); tmp__.write__(os__); } else { state.write__(os__); } } catch(Ice.LocalException ex__) { og__.abort(ex__); } bool ok__ = og__.invoke(); if(!og__.istr().isEmpty()) { try { if(!ok__) { try { og__.throwUserException(); } catch(Ice.UserException ex__) { throw new Ice.UnknownUserException(ex__.ice_name(), ex__); } } og__.istr().skipEmptyEncaps(); } catch(Ice.LocalException ex__) { throw new IceInternal.LocalExceptionWrapper(ex__, false); } } } finally { handler__.reclaimOutgoing(og__); } }
public void setAuthenticator(Murmur.ServerAuthenticatorPrx auth) { setAuthenticator(auth, null, false); }
public void addContextCallback(int session, string action, string text, Murmur.ServerContextCallbackPrx cb, int ctx, _System.Collections.Generic.Dictionary<string, string> context__) { IceInternal.Outgoing og__ = handler__.getOutgoing("addContextCallback", Ice.OperationMode.Normal, context__); try { try { IceInternal.BasicStream os__ = og__.ostr(); os__.writeInt(session); os__.writeString(action); os__.writeString(text); Murmur.ServerContextCallbackPrxHelper.write__(os__, cb); os__.writeInt(ctx); } catch(Ice.LocalException ex__) { og__.abort(ex__); } bool ok__ = og__.invoke(); try { if(!ok__) { try { og__.throwUserException(); } catch(Murmur.InvalidCallbackException) { throw; } catch(Murmur.ServerBootedException) { throw; } catch(Ice.UserException ex__) { throw new Ice.UnknownUserException(ex__.ice_name(), ex__); } } og__.istr().skipEmptyEncaps(); } catch(Ice.LocalException ex__) { throw new IceInternal.LocalExceptionWrapper(ex__, false); } } finally { handler__.reclaimOutgoing(og__); } }
public void setAuthenticator(Murmur.ServerAuthenticatorPrx auth, _System.Collections.Generic.Dictionary<string, string> context__) { setAuthenticator(auth, context__, true); }
public uint GetNameHash() { return(Murmur.Hash2(Name)); }
public int Murmur_string_hash() => Murmur.Hash(testString);