I have a question about how I could have solved this problem better especially because my solution is not scalable in terms of Big-O. So on gmod there is this pointshop, It has a function that sends a notifications to the player:
simplified version for example purpose
SERVER
function Player:PS_Notify(…)
net.Start(‘PS_SendNotification’)
end
CLIENT
net.Receive(‘PS_SendNotification’, function(length)
displayNotification()
end
Now this works for 1 notification, but If i have different Icons or different styled notifications. I don’t want to have to create this
util.AddNetworkString(‘PS_SendNotification1 - version 1’)
util.AddNetworkString(‘PS_SendNotification2 - version 2’)
util.AddNetworkString(‘PS_SendNotification3 version 3’)
Different scenarios require different notifications. Is using this many network strings bad networking? Lucky I only had 3 notification styles because this solved my problem. I just feel kinda dirty. How could I have solved this better? Maybe I should have created a notification handler that activates the notification sequence but has logic that chooses which notification to launch? what would that involve, Local Booleans I’m guessing ?