Author Topic: What are the TNet equivilent of these UNet functions?  (Read 215 times)

MCoburn

  • Jr. Member
  • **
  • Thank You
  • -Given: 1
  • -Receive: 7
  • Posts: 69
    • View Profile
What are the TNet equivilent of these UNet functions?
« on: September 12, 2017, 11:51:33 PM »
I'm starting to convert some UNet code over to TNet and I'm wondering what the TNet equivilent of the following functions are.
If you don't mind, this will be a on-going thread. I'm reading the sources and the examples slowly and starting to understand the events that TNet emits, but I'm a little baffled at the following:

UNet Function - Tasharen Networking Function
OnStartClient - ??? - maybe OnChannelJoin() ?
ClientRpc - ??? - RFC with a client check?
Command - ??? - maybe RCC?

Your pointers are much appreciated.

Cheers,
Matt.

cmifwdll

  • Global Moderator
  • Sr. Member
  • *****
  • Thank You
  • -Given: 0
  • -Receive: 142
  • Posts: 260
  • TNet Alchemist
    • View Profile
Re: What are the TNet equivilent of these UNet functions?
« Reply #1 on: September 13, 2017, 04:29:15 AM »
I don't have much (any) experience with UNet, so I may mislead you unintentionally, but:
OnStartClient seems to match up with OnPlayerJoin. OnPlayerJoin is specifically for when other clients join a channel you're in. OnJoinChannel is for when you join a channel.
ClientRpc and Command seem to be RFCs but differ in who sends / receives it. With TNet, if you want an RFC to execute on the host only, you simply check if TNManager.isHosting returns true. If not, return. Furthermore, the sender has some control over who receives the RFC. Target.Others, Target.Host, Target.All, and others.

Don't forget the tutorials stickied at the top of this forum. They, along with the examples you're already going through, should ease the transition a bit :)

MCoburn

  • Jr. Member
  • **
  • Thank You
  • -Given: 1
  • -Receive: 7
  • Posts: 69
    • View Profile
Re: What are the TNet equivilent of these UNet functions?
« Reply #2 on: September 14, 2017, 08:06:42 PM »
Thanks - I'll give it a shot. :)