Skip to content
This repository has been archived by the owner on Apr 11, 2024. It is now read-only.

Commit

Permalink
Added support for using a custom port for the server/client, thanks N…
Browse files Browse the repository at this point in the history
…OT-FOUND-404-UI for the input
  • Loading branch information
emipa606 committed May 24, 2022
1 parent aebb850 commit befd67c
Show file tree
Hide file tree
Showing 82 changed files with 2,818 additions and 3,432 deletions.
Binary file modified 1.3/Assemblies/PhiClient.dll
Binary file not shown.
Binary file added 1.3/Assemblies/PhiData.dll
Binary file not shown.
Binary file added 1.3/Assemblies/SocketLibrary.dll
Binary file not shown.
Binary file added 1.3/Assemblies/websocket-sharp.dll
Binary file not shown.
22 changes: 13 additions & 9 deletions About/About.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<ModMetaData>
<name>PhiClient (Continued)</name>
<packageId>Mlie.PhiClient</packageId>
Expand Down Expand Up @@ -28,30 +28,34 @@
<li>brrainz.harmony</li>
<li>UnlimitedHugs.HugsLib</li>
</loadAfter>
<description>[img]https://i.imgur.com/WAEzk68.png[/img]
<description>[img]https://i.imgur.com/buuPQel.png[/img]
Update of Longwelwind And Andrews mod
https://steamcommunity.com/sharedfiles/filedetails/?id=1474002997

- For help and info on public servers, join the [url= https://discord.gg/d4Y5xks]Discord - Trading Hub[/url]
- For the client to be able to connect the server must be running an updated version as well
You can download it from the GitHub-repo here:

[img]https://i.imgur.com/7Gzt3Rg.png[/img]
[img]https://i.imgur.com/pufA0kM.png[/img]

[table]
[tr]
[td][url=https://invite.gg/Mlie][img]https://i.imgur.com/zdzzBrc.png[/img][/url][/td]
[td][url=https://github.com/emipa606/PhiClient][img]https://i.imgur.com/kTkpTOE.png[/img][/url][/td]
[/tr]
[/tr]
[tr]
[td][img]https://i.imgur.com/WjDSfUn.png[/img][/td]
[td][img]https://i.imgur.com/h5VwTNL.png[/img][/td]
[/tr]
[/table]

[img]https://i.imgur.com/NOW7jU1.png[/img]
[img]https://i.imgur.com/Z4GOv8H.png[/img]

Online Multi-cities for Rimworld (v1.0)

Phi was originally created by Longwelwind, however he is no longer supporting it. As such I have picked it up and continued development. If the original creator wishes for it to be taken down, I will do so.

This mod allows you to transfer items, animals, and colonists to other people&apos;s games through the server.
This mod allows you to transfer items, animals, and colonists to other people's games through the server.
It also allows you to chat with them.

[strike]NOTE: VERIFY THE SERVER YOU ARE TRYING TO CONNECT TO IS 1.0
Expand All @@ -65,7 +69,7 @@ NOTE:
Huglibs is now required due to apparently new mutli-threaded mod loading


[img]https://i.imgur.com/Rs6T6cr.png[/img]
[img]https://i.imgur.com/PwoNOj4.png[/img]
[list]
[*] See if the the error persists if you just have this mod and its requirements active.
[*] If not, try adding your other mods until it happens again.
Expand All @@ -74,6 +78,6 @@ Huglibs is now required due to apparently new mutli-threaded mod loading
[*] Do not report errors by making a discussion-thread, I get no notification of that.
[*] If you have the solution for a problem, please post it to the GitHub repository.
[/list]
</description>
</ModMetaData>

</description>
</ModMetaData>
3 changes: 3 additions & 0 deletions About/Changelog.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Changelog for PhiClient

1.3.1 - Added support for using a custom port for the server/client, thanks NOT-FOUND-404-UI for the input


1.0.2.0 - Mod updated for 1.3 and passed autotests


Expand Down
2 changes: 1 addition & 1 deletion About/Manifest.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<Manifest>
<identifier>PhiClient</identifier>
<version>1.0.2.0</version>
<version>1.3.1</version>
<dependencies />
<incompatibleWith />
<loadBefore />
Expand Down
2 changes: 1 addition & 1 deletion About/ModSync.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<ModSyncNinjaData>
<ID>43040e0c-aafb-49a1-a4e4-124afecdf4c8</ID>
<ModName>PhiClient (Continued)</ModName>
<Version>1.0.2.0</Version>
<Version>1.3.1</Version>
<SaveBreaking>False</SaveBreaking>
<Host name="Github">
<Owner>emipa606</Owner>
Expand Down
96 changes: 44 additions & 52 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,57 +1,49 @@
# PhiClient
![Image](https://i.imgur.com/WAEzk68.png)

Update of Longwelwind And Andrews mod
https://steamcommunity.com/sharedfiles/filedetails/?id=1474002997

- For help and info on public servers, join the https://discord.gg/d4Y5xks]Discord - Trading Hub
- For the client to be able to connect the server must be running an updated version as well
You can download it from the GitHub-repo here:

![Image](https://i.imgur.com/7Gzt3Rg.png)


[table]
[tr]
[td]https://invite.gg/Mlie]![Image](https://i.imgur.com/zdzzBrc.png)
[/td]
[td]https://github.com/emipa606/PhiClient]![Image](https://i.imgur.com/kTkpTOE.png)
[/td]
[/tr]
[/table]
![Image](https://i.imgur.com/NOW7jU1.png)


Online Multi-cities for Rimworld (v1.0)

Phi was originally created by Longwelwind, however he is no longer supporting it. As such I have picked it up and continued development. If the original creator wishes for it to be taken down, I will do so.

This mod allows you to transfer items, animals, and colonists to other people&apos;s games through the server.
It also allows you to chat with them.

[strike]NOTE: VERIFY THE SERVER YOU ARE TRYING TO CONNECT TO IS 1.0
Attempting to connect to the wrong version will not work.[/strike]

Improvements include:
Pawns now remember eachother across worlds/games.
Animals save completed training (however due to private fields, not partial training)

NOTE:
Huglibs is now required due to apparently new mutli-threaded mod loading


![Image](https://i.imgur.com/Rs6T6cr.png)

![Image](https://i.imgur.com/buuPQel.png)

Update of Longwelwind And Andrews mod
https://steamcommunity.com/sharedfiles/filedetails/?id=1474002997

- For help and info on public servers, join the https://discord.gg/d4Y5xks]Discord - Trading Hub
- For the client to be able to connect the server must be running an updated version as well
You can download it from the GitHub-repo here:

![Image](https://i.imgur.com/pufA0kM.png)

![Image](https://i.imgur.com/Z4GOv8H.png)


Online Multi-cities for Rimworld (v1.0)

Phi was originally created by Longwelwind, however he is no longer supporting it. As such I have picked it up and continued development. If the original creator wishes for it to be taken down, I will do so.

This mod allows you to transfer items, animals, and colonists to other people's games through the server.
It also allows you to chat with them.

[strike]NOTE: VERIFY THE SERVER YOU ARE TRYING TO CONNECT TO IS 1.0
Attempting to connect to the wrong version will not work.[/strike]

Improvements include:
Pawns now remember eachother across worlds/games.
Animals save completed training (however due to private fields, not partial training)

NOTE:
Huglibs is now required due to apparently new mutli-threaded mod loading


![Image](https://i.imgur.com/PwoNOj4.png)



- See if the the error persists if you just have this mod and its requirements active.
- If not, try adding your other mods until it happens again.
- Post your error-log using https://steamcommunity.com/workshop/filedetails/?id=818773962]HugsLib and command Ctrl+F12
- For best support, please use the Discord-channel for error-reporting.
- Do not report errors by making a discussion-thread, I get no notification of that.
- If you have the solution for a problem, please post it to the GitHub repository.



- See if the the error persists if you just have this mod and its requirements active.
- If not, try adding your other mods until it happens again.
- Post your error-log using https://steamcommunity.com/workshop/filedetails/?id=818773962]HugsLib and command Ctrl+F12
- For best support, please use the Discord-channel for error-reporting.
- Do not report errors by making a discussion-thread, I get no notification of that.
- If you have the solution for a problem, please post it to the GitHub repository.



Expand Down
22 changes: 9 additions & 13 deletions Source/03-PhiData/PhiClient/AuthentificationErrorPacket.cs
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);
}
}
29 changes: 11 additions & 18 deletions Source/03-PhiData/PhiClient/AuthentificationPacket.cs
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 Source/03-PhiData/PhiClient/ChangeNicknameNotifyPacket.cs
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);
}
}
46 changes: 21 additions & 25 deletions Source/03-PhiData/PhiClient/ChangeNicknamePacket.cs
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
});
}
}
Loading

0 comments on commit befd67c

Please sign in to comment.