本文整理汇总了C#中SFSObject类的典型用法代码示例。如果您正苦于以下问题:C# SFSObject类的具体用法?C# SFSObject怎么用?C# SFSObject使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
SFSObject类属于命名空间,在下文中一共展示了SFSObject类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: getTutorial
public void getTutorial(string nick, dbCallback getCallback)
{
this.getCallback= getCallback;
SFSObject sfsObject = new SFSObject();
sfsObject.PutUtfString("nick",nick);
extensionManager.sendRequest(new ExtensionRequest("consultarTutorial", sfsObject), "getTutorial", getTutorialResponse);
}
示例2: SendableObject
public SendableObject(SmartFox conn, bool encrypt)
{
provider = EncryptionProvider.GetInstance();
sendEncrypted = encrypt;
connection = conn;
data = new SFSObject();
}
示例3: OnConnection
void OnConnection(BaseEvent evt)
{
bool connectionSuccess = (bool)evt.Params["success"];
Debug.Log("OnConn:" + connectionSuccess);
if (connectionSuccess)
{
SFSObject loginData = new SFSObject();
loginData.PutUtfString("username", usernameField.value);
loginData.PutUtfString("password", passwordField.value);
sfs.Send(new Sfs2X.Requests.LoginRequest("", "", "MainZone", loginData));
connectionWindow.SetActive(false);
loggingWindow.SetActive(true);
}
else
{
sfs = Connection.Instance().Reset();
SetupListeners();
loginWindow.SetActive(true);
connectionWindow.SetActive(false);
}
}
示例4: insertarTutorial
public void insertarTutorial(string nick, string tutorial)
{
SFSObject sfsObject = new SFSObject();
sfsObject.PutUtfString("nick",nick);
sfsObject.PutUtfString("tutorial",tutorial);
extensionManager.sendRequest(new ExtensionRequest("insertarTutorial", sfsObject));
}
示例5: getHighScores
public ArrayList getHighScores(string juego)
{
SFSObject sfsObject = new SFSObject();
sfsObject.PutUtfString("tabla",juego);
extensionManager.sendRequest(new ExtensionRequest("consultarHighScores", sfsObject), "getHighScores", getHighScoresResponse);
return this.ultimaConsultaHighScores;
}
示例6: CreatePublicMessageObject
private ISFSObject CreatePublicMessageObject(JSONObject jsonData, string commandId) {
ISFSObject objOut = new SFSObject();
objOut.PutByteArray("jsonData", Utils.ToByteArray(jsonData.ToString()));
objOut.PutUtfString("message", jsonData.GetString("message"));
objOut.PutUtfString("cmd", commandId);
return objOut;
}
示例7: ReceiveHeading
//This method is called when receiving remote heading
// We update course here
public void ReceiveHeading(SFSObject data)
{
if (receiveMode)
{
Vector3 pos = new Vector3(Convert.ToSingle(data.GetNumber("x")),
Convert.ToSingle(data.GetNumber("y")),
Convert.ToSingle(data.GetNumber("z"))
);
float angle = Convert.ToSingle(data.GetNumber("a"));
long time = (long) data.GetNumber("t");
float speed = Convert.ToSingle(data.GetNumber("s"));
long accelerationTime = (long) data.GetNumber("at");
float endSpeed = -1;
if (accelerationTime != -1)
{
endSpeed = Convert.ToSingle(data.GetNumber("es"));
}
//Debug.Log("ReceiveHeading() has received a heading : "+pos+"; a="+angle+", s="+speed+", t="+time+", at="+accelerationTime+", es="+endSpeed);
course.InitFromValues(pos, angle, time, speed, endSpeed, accelerationTime);
if(hasReceivedHeading == true)
CreateInterceptor();
hasReceivedHeading = true;
}
}
示例8: Play
/// <summary>
/// Начать игру с N количеством игроков
/// </summary>
/// <param name="maxUsers"></param>
void Play(PlayModes playMode)
{
ISFSObject data = new SFSObject();
data.PutUtfString("playMode", Util.EnumToStr(playMode));
data.PutUtfString("nickName", IOL.Instance.UserNick);
SendToLastJoinedRoom(Reqeusts.Play, data);
}
示例9: ReceiveTransform
//This method is called when receiving remote transform
// We update lastState here to know last received transform state
void ReceiveTransform(SFSObject data)
{
Debug.Log("ReceiveTransform()");
if (receiveMode) {
Vector3 pos = new Vector3(Convert.ToSingle(data.GetNumber("x")),
Convert.ToSingle(data.GetNumber("y")),
Convert.ToSingle(data.GetNumber("z"))
);
Quaternion rot = new Quaternion(
Convert.ToSingle(0.0),
Convert.ToSingle(data.GetNumber("ry")),
Convert.ToSingle(0.0),
Convert.ToSingle(data.GetNumber("w"))
);
lastState.InitFromValues(pos, rot);
// Adding next received state to the queue
NetworkTransform nextState = new NetworkTransform(this.gameObject);
nextState.InitFromValues(pos, rot);
queue.Enqueue(nextState);
Debug.Log("queue length: "+Convert.ToString(queue.Count));
}
}
示例10: toSFSObject
public SFSObject toSFSObject()
{
SFSObject asocObject = new SFSObject ();
asocObject.PutLong ("Id_Test", Id_Test);
asocObject.PutLong ("Id_Task", Id_Tarea);
return asocObject;
}
示例11: SendTransform
void SendTransform()
{
if ((timeLastBuffering >= bufferingPeriod)&&((lastAnimation!="idle")||(currentAnimation!="idle"))) {//&&(lastAnimation.Equals("idle"))
lastState = NetworkTransform.FromTransform(thisTransform);
SFSObject data=new SFSObject();
if (!currentAnimation.Equals(lastAnimation))
data.PutUtfString("anim",currentAnimation);
lastState.ToSFSObject(data);
buffer.AddSFSObject(data);
timeLastSending += bufferingPeriod;
packageSize+=1;
timeLastBuffering = 0.0f;
lastAnimation=currentAnimation;
//return;
} else if (!packageSize.Equals(0)){
sendBuffer();
packageSize=0;
}
if (packageSize.Equals(packageMaxSize)){
sendBuffer();
packageSize=0;
//timeLastSending = 0.0f;
}
timeLastBuffering += Time.deltaTime;
}
示例12: getBackNews
//consulta las noticias segun la categoria y facultad
public void getBackNews(string category, string faculty)
{
SFSObject sfsObject = new SFSObject();
sfsObject.PutUtfString("categoria",category);
sfsObject.PutUtfString("facultad",faculty);
//downloadFinished = false;
extensionManager.sendRequest(new ExtensionRequest("consultarNews", sfsObject), "getNews", getNewsResponse);
}
示例13: initPacketFromHost
private void initPacketFromHost(SFSObject aObject) {
long id = aObject.GetLong("i");
for(int i = 0;i<this.sortedHorses.Count;i++) {
if(sortedHorses[i].horseID==id) {
sortedHorses[i].initFromPackage(aObject);
}
}
}
示例14: ForceRemotePlayerToSendTransform
void ForceRemotePlayerToSendTransform(User user)
{
SmartFoxClient client = NetworkController.GetClient();
SFSObject data = new SFSObject();
data.Put("_cmd", "f"); //We put _cmd = "f" here to know that this object contains "force send transform" demand
data.Put("to_uid", user.GetId()); // Who this message is for
client.SendObject(data);
}
示例15: getAvatar
public void getAvatar(string nick, dbCallback getCallback)
{
Debug.Log("Entro al getAvatar---------------!!!");
this.getCallback= getCallback;
SFSObject sfsObject = new SFSObject();
sfsObject.PutUtfString("nick",nick);
extensionManager.sendRequest(new ExtensionRequest("consultarAvatar", sfsObject), "getAvatar", getAvatarResponse);
}