No VirtualUser class in iOS SDK

0 votes

I am trying to integrate VirtualUser in my iOS app.
But the AppWarpS2 SDK does not contain the class "VirtualUser"

As per the documentation mentioned here:

IUser user = (IUser) new VirtualUser("FakeUser", myRoom, myZone);
myRoom.addUser(user, true);

The VirtualUser class is present in Android platform but not in iOS.

Could someone please guide me regarding the same.
Its a very urgent issue.

Thank you

asked Dec 29, 2016 in AppWarpS2 by contact (16 points)

1 Answer

0 votes

Hi Aditya,


VirtualUser is a concept where you can create a bot user on AppwarpS2 so than if there is a single player you can play a game or do communication.

As Its the concept of AppWarpS2 Server where you can create the same using the code snippet you have shared with us. AppWarpS2 server is written in Java language and you can override the same.

It supports will process all the request coming across multiple client SDK platform like Android, iOS, windows,Unity etc.

For iOS App you need only client iOS SDK and do write your game business logic on server in java language.So you can create VirtualUser irrespective of client platform.

Let me know if it helps.


Vishnu Garg


answered Dec 29, 2016 by Vishnu Garg (663 points)
edited Dec 29, 2016 by Vishnu Garg
You can create VirtualUser using the code snippet you have shared with.It behave likes a user as its gets the turn as well. You can write your logic for that on AppWarpS2 server in real time for turn or can we for chat or may be anything.
Hi Vishnu,

I have created custom code and deployed jar file in custom_code console and run successfully.  Now I am adding below code in eclipse but which value i have to pass in myRoom and myZone params? I have room id and zone id.

IUser user = (IUser) new VirtualUser("FakeUser", myRoom, myZone);
myRoom.addUser(user, true);
As I have already explained CustomCode and AppWarpS2 both are separate product. You can use Custom Code in AppWarpS2 but vice versa is not true.
You need to write the Virual User Code on On AppWarp S2 server.
You can go through with here you can find existing samples.
Hi Vishnu,
I'm aware of all the links and information you've provided so far, but the documentation is very vague and not at all sufficient.

Here's the scenario:
My turn based quiz game has a room of 6 players. Game only proceeds when all 6 players join the room.
So I need virtual users to fill that space.

All this while I've used the iOS client SDK to create rooms, players etc in Appwarp.
But now it seems I have to use Appwarp S2 to write custom code for virtual players.

Please help me with the following:
1. Is AppWarp S2 compulsory for creating virtual users?
2. I created the rooms using the client SDK in iOS. So how do I pass the "myRoom" and "myZone" parameters to the server?

Info on these two points will help in completing the gameplay
Yes You need to write your own logic. But its different from App42Custom Code?
Yes you can create virtual User in AppWarpS2.  Please first go through with AppWarpS2 samples that I have provided with the documentation link that will clear all the doubts of you.
You can go through with one sample than i would like to explain how AppWarpS2 extend AppWarp functionality.
Download Widgets
Welcome to ShepHertz Product line forum, where you can ask questions and receive answers from the community. You can also reach out to us on
Migrate from Parse to ShepHertz App42