This repository has been archived by the owner on Apr 11, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added support for using a custom port for the server/client, thanks N…
…OT-FOUND-404-UI for the input
- Loading branch information
Showing
82 changed files
with
2,818 additions
and
3,432 deletions.
There are no files selected for viewing
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 9 additions & 13 deletions
22
Source/03-PhiData/PhiClient/AuthentificationErrorPacket.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,15 @@ | ||
using System; | ||
using System; | ||
using Verse; | ||
|
||
namespace PhiClient | ||
namespace PhiClient; | ||
|
||
[Serializable] | ||
public class AuthentificationErrorPacket : Packet | ||
{ | ||
// Token: 0x02000005 RID: 5 | ||
[Serializable] | ||
public class AuthentificationErrorPacket : Packet | ||
{ | ||
// Token: 0x0400000A RID: 10 | ||
public string error; | ||
public string error; | ||
|
||
// Token: 0x06000002 RID: 2 RVA: 0x0000206E File Offset: 0x0000026E | ||
public override void Apply(User user, RealmData realmData) | ||
{ | ||
Log.Warning("Couldn't authenticate:" + error); | ||
} | ||
public override void Apply(User user, RealmData realmData) | ||
{ | ||
Log.Warning("Couldn't authenticate:" + error); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,19 @@ | ||
using System; | ||
using System; | ||
|
||
namespace PhiClient | ||
namespace PhiClient; | ||
|
||
[Serializable] | ||
public class AuthentificationPacket : Packet | ||
{ | ||
// Token: 0x02000006 RID: 6 | ||
[Serializable] | ||
public class AuthentificationPacket : Packet | ||
{ | ||
// Token: 0x0400000D RID: 13 | ||
public string hashedKey; | ||
public string hashedKey; | ||
|
||
// Token: 0x0400000C RID: 12 | ||
public int? id; | ||
public int? id; | ||
|
||
// Token: 0x0400000B RID: 11 | ||
public string name; | ||
public string name; | ||
|
||
// Token: 0x0400000E RID: 14 | ||
public string version; | ||
public string version; | ||
|
||
// Token: 0x06000004 RID: 4 RVA: 0x0000208E File Offset: 0x0000028E | ||
public override void Apply(User user, RealmData realmData) | ||
{ | ||
} | ||
public override void Apply(User user, RealmData realmData) | ||
{ | ||
} | ||
} |
52 changes: 22 additions & 30 deletions
52
Source/03-PhiData/PhiClient/ChangeNicknameNotifyPacket.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,40 +1,32 @@ | ||
using System; | ||
using System; | ||
using System.Runtime.Serialization; | ||
|
||
namespace PhiClient | ||
namespace PhiClient; | ||
|
||
[Serializable] | ||
public class ChangeNicknameNotifyPacket : Packet | ||
{ | ||
// Token: 0x02000007 RID: 7 | ||
[Serializable] | ||
public class ChangeNicknameNotifyPacket : Packet | ||
{ | ||
// Token: 0x04000011 RID: 17 | ||
public string name; | ||
public string name; | ||
|
||
// Token: 0x0400000F RID: 15 | ||
[NonSerialized] public User user; | ||
[NonSerialized] public User user; | ||
|
||
// Token: 0x04000010 RID: 16 | ||
public int userId; | ||
public int userId; | ||
|
||
// Token: 0x06000006 RID: 6 RVA: 0x00002090 File Offset: 0x00000290 | ||
public override void Apply(User user, RealmData realmData) | ||
{ | ||
this.user.name = name; | ||
} | ||
public override void Apply(User user, RealmData realmData) | ||
{ | ||
this.user.name = name; | ||
} | ||
|
||
// Token: 0x06000007 RID: 7 RVA: 0x000020A3 File Offset: 0x000002A3 | ||
[OnSerializing] | ||
internal void OnSerializingCallback(StreamingContext c) | ||
{ | ||
userId = user.id; | ||
} | ||
[OnSerializing] | ||
internal void OnSerializingCallback(StreamingContext c) | ||
{ | ||
userId = user.id; | ||
} | ||
|
||
// Token: 0x06000008 RID: 8 RVA: 0x000020B8 File Offset: 0x000002B8 | ||
[OnDeserialized] | ||
internal void OnDeserializedCallback(StreamingContext c) | ||
{ | ||
var realmContext = (RealmContext) c.Context; | ||
user = ID.Find(realmContext.realmData.users, userId); | ||
} | ||
[OnDeserialized] | ||
internal void OnDeserializedCallback(StreamingContext c) | ||
{ | ||
var realmContext = (RealmContext)c.Context; | ||
user = ID.Find(realmContext.realmData.users, userId); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,31 @@ | ||
using System; | ||
using System; | ||
using Verse; | ||
|
||
namespace PhiClient | ||
namespace PhiClient; | ||
|
||
[Serializable] | ||
public class ChangeNicknamePacket : Packet | ||
{ | ||
// Token: 0x02000008 RID: 8 | ||
[Serializable] | ||
public class ChangeNicknamePacket : Packet | ||
{ | ||
// Token: 0x04000012 RID: 18 | ||
public string name; | ||
public string name; | ||
|
||
// Token: 0x0600000A RID: 10 RVA: 0x000020F0 File Offset: 0x000002F0 | ||
public override void Apply(User user, RealmData realmData) | ||
public override void Apply(User user, RealmData realmData) | ||
{ | ||
var filteredName = TextHelper.StripRichText(name, "size"); | ||
filteredName = TextHelper.Clamp(filteredName, 4, 32); | ||
if (realmData.users.Any(u => u.name == filteredName)) | ||
{ | ||
var filteredName = TextHelper.StripRichText(name, "size"); | ||
filteredName = TextHelper.Clamp(filteredName, 4, 32); | ||
if (realmData.users.Any(u => u.name == filteredName)) | ||
realmData.NotifyPacket(user, new ErrorPacket | ||
{ | ||
realmData.NotifyPacket(user, new ErrorPacket | ||
{ | ||
error = "Nickname " + filteredName + " is already taken" | ||
}); | ||
return; | ||
} | ||
|
||
user.name = filteredName; | ||
realmData.BroadcastPacket(new ChangeNicknameNotifyPacket | ||
{ | ||
user = user, | ||
name = user.name | ||
error = "Nickname " + filteredName + " is already taken" | ||
}); | ||
return; | ||
} | ||
|
||
user.name = filteredName; | ||
realmData.BroadcastPacket(new ChangeNicknameNotifyPacket | ||
{ | ||
user = user, | ||
name = user.name | ||
}); | ||
} | ||
} |
Oops, something went wrong.